//
//  IntegralDetailCell.m
//  Logistics
//
//  Created by luojinrong11 on 2018/4/20.
//  Copyright © 2018年 com.Logistics. All rights reserved.
//

#import "IntegralDetailCell.h"

@implementation IntegralDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setUseModel:(IntegralUseModel *)useModel {
    _useModel = useModel;
    self.titleLabel.text = useModel.memo;
    self.changePointLabel.text =  useModel.changePoint >0? [NSString stringWithFormat:@"+%.2lf",useModel.changePoint]: [NSString stringWithFormat:@"%.2lf",useModel.changePoint];
    self.TimeLabel.text =  [self getTime:useModel.createAt/1000 Formatter:@"yyyy/MM/dd HH:mm"];
}

-(NSString *)getTime:(long long)stamp Formatter:(NSString *)formatter{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
    [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
    [dateFormatter setDateFormat:formatter];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:stamp];
    return [dateFormatter stringFromDate:date];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
